
#ifndef _MEMBER_BDIALOG_H_
#define _MEMBER_BDIALOG_H_

#include <BButton>
#include <BHBoxLayout>
#include <BDialog>
#include "IAlignment.h"

namespace BWE
{
	class member_BDialog : public BObject
	{
		friend class BDialog;
	public:
		static const char* ButtonName(Button button);
		static Graph ButtonGraph(Button button);
		static BIcon* ButtonIcon(Button button);

	public:
		member_BDialog(BDialog* dialog);
		~member_BDialog();

		bool resizable();
		void adaptSize();
		void centerAlign();
		void freshRects();

		void slotParentChanged(BObject* object, const BValue& value);
		void slotParentResized(BObject* object, const BValue& value);
		void slotButtonClicked(BButton* button, const BValue& value);

		BDialog*			boss;
		BWidget*			parent;
		bool				titleVisible;
		BSize				titleIconSize;
		BMargin				titleMargin;
		int					titleSpace;
		int					titleHeight;
		const BStyle*		titleStyle;
		bool				autoTop;
		IAlignment			alignment;
		BValue				result;
		ShowState			showState;
		BRect				normalRect;
		BMargin				normalMargin;
		bool				centering;
		bool				adapting;
		Align				buttonAlign;
		BHBoxLayoutHolder	buttonLayout;

		Part			resizePart;
		BRect			titleRect;
		BRect			borderTop;
		BRect			borderLeft;
		BRect			borderRight;
		BRect			borderBottom;
		BRect			cornerLeftTop;
		BRect			cornerRightTop;
		BRect			cornerLeftBottom;
		BRect			cornerRightBottom;

		bool			dirty;
		bool			hoverTitle;
		bool			pressed;
		BPoint			pressedPos;
		BRect			pressedRect;
	};
}

#endif